From 77d7c713d4be60ec45a78668b6667aa24b5c6eb5 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 13 Feb 2020 07:33:18 +0100 Subject: [PATCH] roundedrect: Fix inlining of graphene functions graphene treats equality for contains() operations as always matching, so do the same thing. This is because unlike integer math, floating point cannot do the "as close as possible to the point, but not reaching it" operation that integer does by just subtracting 1. --- gsk/gskroundedrect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gsk/gskroundedrect.c b/gsk/gskroundedrect.c index 2e01589639..4d95d52666 100644 --- a/gsk/gskroundedrect.c +++ b/gsk/gskroundedrect.c @@ -340,8 +340,8 @@ gsk_rounded_rect_locate_point (const GskRoundedRect *self, { if (point->x < self->bounds.origin.x || point->y < self->bounds.origin.y || - point->x >= self->bounds.origin.x + self->bounds.size.width || - point->y >= self->bounds.origin.y + self->bounds.size.height) + point->x > self->bounds.origin.x + self->bounds.size.width || + point->y > self->bounds.origin.y + self->bounds.size.height) return OUTSIDE; if (self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width > point->x && @@ -417,8 +417,8 @@ gsk_rounded_rect_contains_rect (const GskRoundedRect *self, { if (rect->origin.x < self->bounds.origin.x || rect->origin.y < self->bounds.origin.y || - rect->origin.x + rect->size.width >= self->bounds.origin.x + self->bounds.size.width || - rect->origin.y + rect->size.height >= self->bounds.origin.y + self->bounds.size.height) + rect->origin.x + rect->size.width > self->bounds.origin.x + self->bounds.size.width || + rect->origin.y + rect->size.height > self->bounds.origin.y + self->bounds.size.height) return FALSE; if (!gsk_rounded_rect_contains_point (self, &rect->origin) || -- 2.30.2